# $Id$
# Maintainer: Antonio Rojas <arojas@archlinux.org> 

pkgname=discover
pkgver=5.10.95
pkgrel=1
pkgdesc='KDE and Plasma resources management GUI'
arch=(i686 x86_64)
url='https://projects.kde.org/projects/kde/workspace/discover'
license=(LGPL)
depends=(knewstuff kdeclarative kitemmodels qt5-graphicaleffects appstream-qt archlinux-appstream-data
         hicolor-icon-theme kirigami2 qt5-quickcontrols)
makedepends=(extra-cmake-modules python plasma-framework packagekit-qt5 flatpak)
optdepends=('packagekit-qt5: to manage packages from Arch Linux repositories' 'flatpak: Flatpak packages support')
conflicts=(muon)
replaces=(muon)
groups=(plasma)
source=("https://download.kde.org/unstable/plasma/$pkgver/$pkgname-$pkgver.tar.xz"{,.sig} discover-no-deb-rpm.patch)
sha256sums=('8ed6a95b7d1c2e1c4ddfc6794d2953b05d3507a75e0550d643312a275242c1fe'
            'SKIP'
            '1910a7a95c8537cdf59fea87bdb4a4ac750d073c63182536358ef5c75508521d')
validpgpkeys=('2D1D5B0588357787DE9EE225EC94D18F7F05997E'  # Jonathan Riddell
              '348C8651206633FD983A8FC4DEACEA00075E1D76'  # KDE Neon
              'D07BD8662C56CB291B316EB2F5675605C74E02CF') # David Edmundson

prepare() {
  mkdir -p build

  cd $pkgname-$pkgver
# Don't handle .rpm or .deb files
  patch -p1 -i ../discover-no-deb-rpm.patch
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DKDE_INSTALL_LIBDIR=lib \
    -DKDE_INSTALL_LIBEXECDIR=lib \
    -DBUILD_TESTING=OFF
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
}
